home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / boot / initrd.img-2.6.28-15-generic / initrd.img-2.6 / scripts / casper-bottom / 43disable_updateinitramfs < prev    next >
Encoding:
Text File  |  2009-10-12  |  905 b   |  47 lines

  1. #!/bin/sh
  2. # Fix for LP#150188
  3.  
  4. PREREQ=""
  5. DESCRIPTION="Possibly disabling update-initramfs (useless on a live CD)..."
  6.  
  7. . /scripts/casper-functions
  8.  
  9. prereqs()
  10. {
  11.        echo "$PREREQ"
  12. }
  13.  
  14. case $1 in
  15. # get pre-requisites
  16. prereqs)
  17.        prereqs
  18.        exit 0
  19.        ;;
  20. esac
  21.  
  22. log_begin_msg "$DESCRIPTION"
  23.  
  24. chroot /root dpkg-divert --add --rename --quiet \
  25.         /usr/sbin/update-initramfs
  26. # Running off a USB disk or other writable media.
  27. if [ -w /root/cdrom ] && \
  28.    ! grep -q '^[^ ]* /root/cdrom [^ ]* [^ ]*\<ro\>' /proc/mounts; then
  29.     cat > /root/usr/sbin/update-initramfs <<'EOF'
  30. #! /bin/sh
  31. update-initramfs.distrib "$@"
  32. cp /initrd.img /cdrom/casper/initrd.gz
  33. cp /vmlinuz /cdrom/casper/vmlinuz
  34. exit 0
  35. EOF
  36. else
  37.     cat > /root/usr/sbin/update-initramfs <<EOF
  38. #! /bin/sh
  39. echo "update-initramfs is disabled since running on read-only media"
  40. exit 0
  41. EOF
  42. fi
  43.  
  44. chmod 755 /root/usr/sbin/update-initramfs
  45.  
  46. log_end_msg
  47.